unit IzbiraZapisaFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DialogBaseFrm, cxStyles, cxGraphics, cxEdit, cxClasses,
  cxGridBandedTableView, ImgList, cxEditRepositoryItems, cxContainer, StdActns,
  ActnList, cxControls, cxInplaceContainer, cxVGrid, StdCtrls, ExtCtrls, BaseFrm,
  cxTextEdit, cxMaskEdit, cxSpinEdit, cxLabel, cxRadioGroup,
  cxExtEditRepositoryItems, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
  dxSkinsDefaultPainters;

type
  TfrmIzbiraZapisa = class(TfrmDialogBase)
    grpbxMain: TGroupBox;
    rdbtnTrenutniZapis: TcxRadioButton;
    rdbtnSkupinaZapisov: TcxRadioButton;
    edtOdStevilke: TcxSpinEdit;
    edtDoStevilke: TcxSpinEdit;
    rpstMainVrednost: TcxEditRepositorySpinItem;
    lblDo: TLabel;
    procedure FormShow(Sender: TObject);
    procedure OnClick(Sender: TObject);
  private
    function GetIzbira: Integer;
    procedure SetIzbira(const Value: Integer);
    { Private declarations }
  protected
    procedure SetDefaultControl; override;
  public
    property Izbira: Integer read GetIzbira write SetIzbira;
  end;

var
  frmIzbiraZapisa: TfrmIzbiraZapisa;

implementation

{$R *.dfm}

{ TfrmIzbiraZapisa }

procedure TfrmIzbiraZapisa.FormShow(Sender: TObject);
begin
  inherited;
  rdbtnTrenutniZapis.Checked := True;
  edtOdStevilke.Enabled := False;
  edtDoStevilke.Enabled := False;
end;

function TfrmIzbiraZapisa.GetIzbira: Integer;
begin
  Result := 0;
  if rdbtnTrenutniZapis.Checked then
    Result := 1
  else if rdbtnSkupinaZapisov.Checked then
    Result := 2;
end;

procedure TfrmIzbiraZapisa.OnClick(Sender: TObject);
begin
  if (Sender = rdbtnTrenutniZapis) or (Sender = rdbtnSkupinaZapisov) then
  begin
    if rdbtnSkupinaZapisov.Checked then
    begin
      edtOdStevilke.Enabled := True;
      edtDoStevilke.Enabled := True;
    end
    else begin
      edtOdStevilke.Enabled := False;
      edtDoStevilke.Enabled := False;
    end;
  end;
end;

procedure TfrmIzbiraZapisa.SetDefaultControl;
begin
  inherited;
  ActiveControl := rdbtnTrenutniZapis;
end;

procedure TfrmIzbiraZapisa.SetIzbira(const Value: Integer);
begin

end;

end.
